cmake_minimum_required(VERSION 3.29)
project(UUV)

set(CMAKE_CXX_FLAGS "-std=c++11")
# 设置MATLAB路径
set(MATLAB_ROOT "/usr/local/MATLAB/R2023b")

# 添加MATLAB的头文件路径
include_directories(${MATLAB_ROOT}/extern/include)

# 添加MATLAB的库文件路径
link_directories(${MATLAB_ROOT}/extern/bin/glnxa64)


# 添加Eigen头文件
include_directories( "/usr/include/eigen3" )
# 添加Pangolin依赖
find_package( Pangolin )
include_directories( ${Pangolin_INCLUDE_DIRS} )


add_library(uuv SHARED UUV.cpp)
add_library(cross SHARED cross.cpp)
add_library(DrawTrajectory SHARED DrawTrajectory.cpp)
add_library(Eular2Isometry SHARED Eular2Isometry.cpp)

add_library(controller SHARED controller.cpp)
add_library(g SHARED g.cpp)


add_executable(UUV main.cpp)



target_link_libraries( uuv  cross)
target_link_libraries( uuv  Eular2Isometry)
target_link_libraries( UUV  DrawTrajectory)
target_link_libraries( UUV  uuv)

target_link_libraries( UUV  controller)
target_link_libraries( controller  g)

target_link_libraries( UUV ${Pangolin_LIBRARIES} )



# 链接MATLAB库
target_link_libraries(DrawTrajectory libMatlabDataArray.so libMatlabEngine.so)